$(function() {
	$(".gotoGoodsDetail").click(function() {
		var goodsItem = {};

		goodsItem.name = $(this).children("div").eq(1).children("div").children("p").text();
		goodsItem.price = $(this).children("div").eq(2).children("p").eq(0).children("label").text();
		goodsItem.repertory = $(this).children("div").eq(2).children("p").eq(1).children("label").text();
		goodsItem.imgSrc = $(this).children("div").eq(0).children("img").attr("src");

		localStorage.setItem("$detail", JSON.stringify(goodsItem));

		window.location.href = "new-personal-details.html";

	});
	
	
	//判断有没有登陆，没有则跳转到登陆页
	$("#gotoShoppingCar").click(function(){
		if(localStorage.getItem("$loginUser") == null){
			window.location.href = "login.html"
		}else{
			window.location.href = "new-shopping-card.html"
		}
	});
	
});